﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Cosmetic.Logic;

namespace WebApp.Controls
{
    public partial class DiffColorProduct : System.Web.UI.UserControl
    {
        ProductManager PM = new ProductManager();


        protected void Page_Load(object sender, EventArgs e)
        {
            

        }

        public void Bind(string ProductId)
        {
            Cosmetic.DataEntity.Product aProduct = PM.GetProductById(new Guid(ProductId));
                
            var result = PM.GetSimilarProductInfo(aProduct);

            if (result == null || result.Count == 0)
            {
                this.Panel1.Visible = false;
            }
            else
            {
                this.Repeater1.DataSource = result;
                this.Repeater1.DataBind();
                this.Panel1.Visible = true;
            }
        }
    }
}